﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BloxGin.Blocks;

namespace BloxGame
{
    
    public class Block 
    { 
        public const float BlockSize = 1.0f;

        public BlockTypes Type;

        public Block(BlockTypes blockType) 
        { 
            Type = blockType; 
        }

        public static implicit operator Block(byte b)
        {
            return new Block((BlockTypes)b);
        }

        public static implicit operator byte(Block b)
        {
            return (byte)b.Type;
        }


        public static implicit operator Block(BlockTypes b)
        {
            return new Block(b);
        }

        public static implicit operator BlockTypes(Block b)
        {
            return b.Type;
        }

        public static bool operator ==(Block a, byte b)
        {
            BlockTypes type1 = a.Type;
            BlockTypes type2 = (BlockTypes)b;
            return type1 == type2;
        }
        public static bool operator !=(Block a, byte b)
        {
            return !(a == b);
        }


    } 
}
